package com.dxf.bigdata.D05_spark_again.action

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object count_first_take {

  def main(args: Array[String]): Unit = {

    val sparkConf = new SparkConf().setMaster("local[*]").setAppName("app")
    val sc = new SparkContext(sparkConf)

    val value: RDD[Int] = sc.makeRDD(List(1, 2, 3, 4))
    // 触发作业job执行  sc.runJob
    val l: Long = value.count()

    val i: Int = value.first()

    val ints: Array[Int] = value.take(3)

    println(i)
    sc.stop()

  }

}
